<?php
$this->breadcrumbs=array(
	'Gestores'=>array('index'),
	'Gerenciando',
);

$this->menu=array(
	array('label'=>'Listar Gestores', 'url'=>array('index')),
	array('label'=>'Novo Gestor', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('cad-gestor-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Gestores</h1>

<?php
//echo CHtml::link('Busca avançada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php
//$this->renderPartial('_search',array(
//	'model'=>$model,
//)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'cad-gestor-grid',
        'pager' => array('cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/gridView.css'),
        'cssFile' => Yii::app()->baseUrl . '/themes/'.Yii::app()->theme->name.'/css/gridView.css',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'cod_gestor',
                array(
                       'name'=>'cod_associacao',
                       'type'=>'raw',
                       'value'=>'cad_associacao::loadTableAssociado($data->cod_associacao)'
                    ),  
		'razao_social',
		'cnpj',
		'logradouro',
		'numero',
		/*
		'complemento',
		'bairro',
		'cep',
		'cidade',
		'estado',
		'banco',
		'conta_corrente',
		'agencia',
		'gestor',
		'tel',
		'e_mail',
		*/
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
